Learn R Programming

SpaDES (version 1.0.1)

setColors<-: Set colours for plotting Raster* objects.

Description

Set colours for plotting Raster* objects.

Usage

setColors(object, ..., n) <- value

## S3 method for class 'RasterLayer,numeric,character':
setColors(object, ..., n) <- value

## S3 method for class 'RasterLayer,missing,character':
setColors(object, ..., n) <- value

## S3 method for class 'Raster,numeric,list':
setColors(object, ..., n) <- value

## S3 method for class 'Raster,missing,list':
setColors(object, ..., n) <- value

Arguments

object
A Raster* object.
...
Additional arguments to colorRampPalette.
n
An optional vector of values specifiying the number of levels from which to interpolate the color palette.
value
Named list of hex color codes (e.g., from RColorBrewer::brewer.pal), corresponding to the names of RasterLayers in x.

Value

  • Returns a Raster with the colortable slot set to values.

See Also

brewer.pal, colorRampPalette.